Interface ICollectionValue<T>

A generic collection that may be enumerated and can answer efficiently how many items it contains. Like IEnumerable<T>, this interface does not prescribe any operations to initialize or update the collection. The main usage for this interface is to be the return type of query operations on generic collection.

Implements

IEnumerable<T>, System.Collections.IEnumerable, System.IFormattable, IShowable

Implemented by

ArrayBase<T>, ArrayBase<T>.Range, ArrayList<T>, CircularQueue<T>, CollectionBase<T>, CollectionValueBase<T>, DictionaryBase<K,V>, DirectedCollectionBase<T>, DirectedCollectionValueBase<T>, GuardedCollection<T>, GuardedCollectionValue<T>, GuardedDictionary<K,V>, GuardedDirectedCollectionValue<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedQueue<T>, GuardedSequenced<T>, GuardedSorted<T>, GuardedSortedDictionary<K,V>, HashBag<T>, HashDictionary<K,V>, HashedArrayList<T>, HashedLinkedList<T>, HashSet<T>, IntervalHeap<T>, LinkedList<T>, SequencedBase<T>, SortedArray<T>, SortedDictionaryBase<K,V>, TreeBag<T>, TreeDictionary<K,V>, TreeSet<T>, WrappedArray<T>

Super

ICollection<T>, IDictionary<K,V>, IDirectedCollectionValue<T>, IExtensible<T>, IIndexed<T>, IIndexedSorted<T>, IList<T>, IPersistentSorted<T>, IPriorityQueue<T>, IQueue<T>, ISequenced<T>, ISorted<T>, ISortedDictionary<K,V>, IStack<T>

Event overview

CollectionChanged ,
CollectionCleared ,
ItemInserted ,
ItemRemovedAt ,
ItemsAdded ,
ItemsRemoved

Property overview

ActiveEvents ,
Count ,
CountSpeed ,
IsEmpty ,
ListenableEvents

Method overview

All(Fun<T,bool> predicate) ,
Apply(Act<T> action) ,
Choose() ,
CopyTo(T[] array, int index) ,
Exists(Fun<T,bool> predicate) ,
Filter(Fun<T,bool> filter) ,
Find(Fun<T,bool> predicate, out T item) ,
ToArray()

Event details

CollectionChangedHandler<T> CollectionChanged The change event. Will be raised for every change operation on the collection.
CollectionClearedHandler<T> CollectionCleared The change event. Will be raised for every clear operation on the collection.
ItemInsertedHandler<T> ItemInserted The item inserted event. Will be raised for every individual insertion to the collection.
ItemRemovedAtHandler<T> ItemRemovedAt The item removed at event. Will be raised for every individual removal at from the collection.
ItemsAddedHandler<T> ItemsAdded The item added event. Will be raised for every individual addition to the collection.
ItemsRemovedHandler<T> ItemsRemoved The item removed event. Will be raised for every individual removal from the collection.

Property details

A EventTypeEnum ActiveEventsAccess: Read-Only

Value:

A flag bitmap of the events currently subscribed to by this collection.
A int CountAccess: Read-Only

Value:The number of items in this collection

A Speed CountSpeedAccess: Read-Only

Value:A characterization of the speed of the Count property in this collection.

The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
A bool IsEmptyAccess: Read-Only

Value:True if this collection is empty.

A EventTypeEnum ListenableEventsAccess: Read-Only

Value:

A flag bitmap of the events subscribable to by this collection.

Method details

A bool All(Fun<T,bool> predicate) Check if all items in this collection satisfies a specific predicate.
Returns:True if all items satisfies the predicate
Parameters:
predicate:A delegate (Fun<A1,R> with R == bool) defining the predicate
A void Apply(Act<T> action) Apply a delegate to all items of this collection.
Parameters:
action:The delegate to apply
A T Choose() Choose some item of this collection.

Implementations must assure that the item returned may be efficiently removed.

Implementors may decide to implement this method in a way such that repeated calls do not necessarily give the same result, i.e. so that the result of the following test is undetermined: coll.Choose() == coll.Choose()

Throws
NoSuchItemExceptionif collection is empty.
Returns:
A void CopyTo(T[] array, int index) Copy the items of this collection to a contiguous part of an array.
Parameters:
array:The array to copy to
index:The index at which to copy the first item
A bool Exists(Fun<T,bool> predicate) Check if there exists an item that satisfies a specific predicate in this collection.
Returns:True is such an item exists
Parameters:
predicate:A delegate (Fun<A1,R> with R == bool) defining the predicate
A IEnumerable<T> Filter(Fun<T,bool> filter) Create an enumerable, enumerating the items of this collection that satisfies a certain condition.
Returns:The filtered enumerable
Parameters:
filter:The T->bool filter delegate defining the condition
A bool Find(Fun<T,bool> predicate, out T item) Check if there exists an item that satisfies a specific predicate in this collection and return the first one in enumeration order.
Returns:True is such an item exists
Parameters:
predicate:A delegate (Fun<A1,R> with R == bool) defining the predicate
item:
A T[] ToArray() Create an array with the items of this collection (in the same order as an enumerator would output them).
Returns:The array